﻿using BattleFury.Lib.Network.Packets;
using System.ComponentModel;

namespace BattleFury.Server
{
    public partial class FuryServer
    {
        private void MonitorIncomingPacketsQueue(object sender, DoWorkEventArgs e)
        {
            BackgroundWorker _worker = (BackgroundWorker)sender;
            IPacket p;
            while (IsRunning)
            {
                while (_incomingPackets.TryDequeue(out p))
                {
                    //Get these packets to the game
                    _sBFG.Networking_ReceivePacket(p);
                }
            }
        }
    }
}
